package com.gpstracker.services;

import android.app.Service;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.IBinder;
import android.util.Log;

import com.gpstracker.db.MyDatabase;

public class OneShootSybwayService extends Service {

	private Runner runner;

	private final String TAG = "ONE_SHOOT_SUBWAY_SERVICE";
	MyDatabase db;
	private SharedPreferences prefs;



	class Runner extends Thread{

		@Override
		public void run() {
			// TODO Auto-generated method stub
			super.run();
			db.insertLocation(0.0, 0.0, "network", 0, 0, "subway");
		}
	}


	@Override
	public void onCreate() {

		Log.i(TAG, "oncreate");
		db=new MyDatabase(getApplicationContext());
		db.open();
		runner = new Runner();
		runner.start();
		
		this.stopSelf();
	}

	@Override
	public void onDestroy() {

		Log.i(TAG, "onDestroy");
		synchronized(this) {
			this.notify();
		}
	}
	
	@Override
	public IBinder onBind(Intent arg0) {
		// TODO Auto-generated method stub
		return null;
	}

}

